import request from "./request";

//根据上传到服务器的pdb文件获取moletype和sequence
function getMoleAndSequence() {
  return request({
    loading: true, //是否显示加载效果
    url: "/panda/info/getHeader",
    method: "GET",
  });
}

//获取ATOM表格（分页）
function getAtomTable(params) {
  return request({
    loading: false,
    url: "/panda/info/getAtom",
    method: "GET",
    params,
  });
}
//获取HETATM表格（分页）
function getHetatmTable(params) {
  return request({
    loading: false,
    url: "/panda/info/getHetatm",
    method: "GET",
    params,
  });
}
//导出ATOM集合
function exportAtomFile(param) {
  return request({
    loading: true, //是否显示加载效果
    url: "/panda/info/atomDownload",
    method: "POST",
    params: {
      condition: param,
    },
    responseType: "blob", //blob流(必须需要！！)
  });
}

//导出HETATM集合
function exportHetatmFile(param) {
  return request({
    loading: true, //是否显示加载效果
    url: "/panda/info/hetatmDownload",
    method: "POST",
    params: {
      condition: param,
    },
    responseType: "blob", //blob流(必须需要！！)
  });
}

export {
  getMoleAndSequence,
  getAtomTable,
  getHetatmTable,
  exportAtomFile,
  exportHetatmFile,
};
